﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Devonline.Core;

/// <summary>
/// http method type
/// </summary>
[Description("Http 请求类型"), Flags]
public enum HttpMethod
{
    /// <summary>
    /// http get
    /// </summary>
    [Display(Name = "GET")]
    Get = 0x01,
    /// <summary>
    /// http post
    /// </summary>
    [Display(Name = "POST")]
    Post = 0x02,
    /// <summary>
    /// http put
    /// </summary>
    [Display(Name = "PUT")]
    Put = 0x04,
    /// <summary>
    /// http delete
    /// </summary>
    [Display(Name = "DELETE")]
    Delete = 0x08,
    /// <summary>
    /// http head
    /// </summary>
    [Display(Name = "HEAD")]
    Head = 0x10,
    /// <summary>
    /// http options
    /// </summary>
    [Display(Name = "OPTIONS")]
    Options = 0x20,
    /// <summary>
    /// http patch
    /// </summary>
    [Display(Name = "PATCH")]
    Patch = 0x40,
    /// <summary>
    /// http trace
    /// </summary>
    [Display(Name = "TRACE")]
    Trace = 0x80,

    /// <summary>
    /// Create, Update, Read, and Delete for http get, post, put and delete
    /// </summary>
    [Display(Name = "CURD")]
    CURD = Get | Post | Put | Delete,

    /// <summary>
    /// all http method
    /// </summary>
    [Display(Name = "ALL")]
    All = 0xFF
}